# -*- coding: utf-8 -*-
"""
-------------------------------------------------
Project Name: luffcity study project
File Name: 函数作用域练习.py
Author: kij
Create Date: 2021/2/14
-------------------------------------------------
"""
# import random
# print(random.randint(1,9))
# res = ''
# for i in range(6):
# 	s1= chr(random.randint(65,90))
# 	print(s1)


# ###################### 函数 ######################
# 示例1
"""
v1 = "嫂子"
def func():
    print(v1)
func()
"""

# 示例2
"""

v1 = "嫂子"
def func():
    v1 = "饺子"
    print(v1)
func()
"""
# 示例3
"""
v1 = "嫂子"
def func():
    print(v1)    # UnboundLocalError: local variable 'v1' referenced before assignment
    v1 = "饺子"
func()
"""

# ###################### 类 ######################
# 示例4
"""
v1 = "嫂子"

class Foo:
    print(v1)
"""

# 示例5
"""
v1 = "嫂子"

class Foo:
    v1 = "饺子"
    print(v1)
"""

# 示例6
"""
v1 = "嫂子"

class Foo:
    print(v1)
    v1 = "饺子"
"""